import Network from './network';

/**
 * 登录
 * @param data
 * @returns {Promise<unknown>}
 */
export const login = (data) => Network.post('/mall-sys-user/login', data);

/**
 * 菜单列表
 * @param data
 * @returns {Promise<unknown>}
 */
export const queryModelPage= (data) => Network.get('/mall-menu-role/getByModuleCode', data);

/**
 * 保存菜单
 * @param data
 * @returns {Promise<unknown>}
 */
export const saveModel= (data) => Network.post('/mall-menu/save', data);

/**
 * 根据id查询菜单详情
 * @param data
 * @returns {Promise<unknown>}
 */
export const getByModelId= (data) => Network.get('/mall-menu-role/getById', data);

/**
 * 删除菜单
 */
export const deleteByModelId= (data) => Network.delete('/mall-menu/del', data);

/**
 * 更新菜单
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const updatedByModel= (data) => Network.post('/mall-menu/upt', data);
